<?
//inculde即可以使用data数据。本页所有的data数据，倾在controller都处理好
include_once("../../../common/module/checkA.php");
include_once("../../../../config.php");
include_once("../controller/detail-add.php");
?>



<?
//用来判断当前系统属于什么板块
$system_part = $plate['mid'];
include_once("detail-list-function.php"); 
?>
 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
       <?php include ROOT_PATH_.'/controller/common/module/head.php'; ?>
    <?php include 'modules/head.php'; ?>
    <link href="../asset/css/style.css" rel="stylesheet" type="text/css"/>
</head>

<body class="case">

<div id="topbar">   <?php include ROOT_PATH_.'/controller/common/module/topbar.php'; ?></div>

<div id="container" class="<? echo $system_part ?>">

    <div id="maincontent">

        <div id="sidebar">
            <?php include ROOT_PATH_.'/controller/common/module/sidebar.php'; ?>
        </div>


<div id="content"> 




<div class="box detail-box  layui-form">

    <h1> 项目资料 </h1>

<form id="add-form" method="post" action="detail-add-function.php?nav-itemed=member" enctype="multipart/form-data" class="layui-form">



<input type="hidden" name="nid" value="<? echo $detail['nid']?>">
<fieldset class="layui-elem-field layui-field-title">
<legend> 基本信息 </legend>
</fieldset>







    <div class="left_content">

        <div class="layui-form-item">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-block">
                <input type="text" name="ai_name" required  lay-verify="required" placeholder="请输入项目名称" autocomplete="off" class="layui-input" value="<? echo $detail['name']?>">
            </div>
        </div>



        <div class="layui-form-item" style="display: none">
            <label class="layui-form-label">编号</label>
            <div class="layui-input-block">
                <input type="text" name="ai_mid"   autocomplete="off" class="layui-input"  value="<? echo date("Y-md-Hi")?>">
            </div>
        </div>


        <?
        $unit_list=select_lines_all_items($table_Prefix."unit","nid desc","relation = '客户'","0");
        $unit=select_one_line_all_items($table_Prefix."unit","nid = '".$_REQUEST['nid']."'");
        ?>


        <div class="layui-form-item">
            <label class="layui-form-label">所属单位</label>
            <div class="layui-input-block">
                <select name="ai_unit" lay-search="" style="z-index: 9999" >
                    <option value="<? echo $_REQUEST['nid']?>"><? echo $_REQUEST['nid']." : ".$unit['name']?></option>
                    <option value="">无</option>
                    <? for($i=0;$i<count($unit_list);$i++){ ?>
                        <option value="<? echo $unit_list[$i]['nid'] ?>"><? echo $unit_list[$i]['nid'] ?> : <? echo $unit_list[$i]['name'] ?></option>
                    <? } ?>
                </select>
                <div class="notice">列表没有对应的单位信息，请先选择无或先添加单位信息（后续自动建立，开发中）</div>

            </div>
        </div>



    </div>







    <div class="right_content">


        <div class="layui-form-item">
            <label class="layui-form-label">合同金额</label>
            <div class="layui-input-block">
                <input type="text" name="ai_contract_sum"   autocomplete="off" class="layui-input" placeholder="签订合同的金额，其中包含介绍费中介费"  value="<? echo $detail['contract_sum']?>">
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label">实际金额</label>
            <div class="layui-input-block">
                <input type="text" name="ai_sum" placeholder="减去佣金后的金额，主要用于统计真实营业额"   autocomplete="off" class="layui-input"  value="<? echo $detail['sum']?>">
            </div>
        </div>









    </div>








        <div class="layui-form-item">
            <label class="layui-form-label">项目类型</label>
            <div class="layui-input-block">

            <? foreach ($tag_array as $k => $v) { ?>
                <input type="radio" name="ai_type" value="<? echo $v ?>" title="<? echo $v ?>" />
            <?;
            } ?>

            <div class="notice">项目类型可以在<a href="plate-edit.php?sys_part=case">【板块设置】</a>中设置</div>
            </div>
        </div>


    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block" >
            <? foreach ($progress_array as $k => $v){?>
                <input type="radio" name="ai_status"  value="<?echo $v?>"    title="<?echo $v?>"  <? if($detail['type']==$v)      {echo "checked";} ?>>
                <?;}?>
        </div>

    </div>




    <br/>

    <fieldset class="layui-elem-field layui-field-title">
        <legend> <i class="fa fa-tasks"></i> 时间节点 </legend>
    </fieldset>






    <div class="layui-row">
        <div class="layui-col-xs6 layui-col-sm6 layui-col-md4">
            <div class="layui-form-item">
                <label class="layui-form-label">签约日期</label>
                <div class="layui-input-block">
                    <input type="text" name="ai_signingdate" id="date" autocomplete="off" 
                           class="layui-input laydate-icon laydate_date"
                           value="<? echo date("Y-m-d")?>"
                            >
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">付款日期</label>
                <div class="layui-input-block">
                    <input type="text" name="ai_paydate" id="date" autocomplete="off"
                           class="layui-input laydate-icon laydate_date"
                           value="<? echo date("Y-m-d")?>"
                            >
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label">结算日期</label>
                <div class="layui-input-block">
                    <input type="text" name="ai_count_date" id="date" autocomplete="off"
                           class="layui-input laydate-icon laydate_date"
                           value="<? echo date("Y-m-d")?>"
                            >
                </div>
            </div>

        </div>




        <div class="layui-col-xs6 layui-col-sm6 layui-col-md4">
            <div class="grid-demo">

                <div class="layui-form-item">
                    <label class="layui-form-label">开始日期</label>
                    <div class="layui-input-block">
                        <input type="text" name="ai_startdate" id="date" autocomplete="off"
                               class="layui-input laydate-icon laydate_date"
                               value="<? echo date("Y-m-d")?>"
                                >
                    </div>
                </div>



                <div class="layui-form-item">
                    <label class="layui-form-label">完成日期</label>
                    <div class="layui-input-block">
                        <input type="text" name="ai_enddate" id="date" autocomplete="off"
                               class="layui-input laydate-icon laydate_date"
                               value="<? echo date("Y-m-d")?>"
                                >
                    </div>
                </div>

            </div>
        </div>







        <div class="layui-col-xs4 layui-col-sm12 layui-col-md4">

            <div class="expect_dates">

                <div class="layui-form-item">
                    <label class="layui-form-label">计划签约</label>
                    <div class="layui-input-block">
                        <input type="text" name="ai_expect_startdate" id="date" autocomplete="off"
                               class="layui-input laydate-icon laydate_date"
                               value="<? echo date("Y-m-d")?>"
                               
                               >
                        <div class="item-tips">派单业务须在此前完成签约</div>
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">计划完成</label>
                    <div class="layui-input-block">
                        <input type="text" name="ai_expect_enddate" id="date" autocomplete="off"
                               class="layui-input laydate-icon laydate_date"
                               value="<? echo date("Y-m-d")?>"
                               
                               >
                        <div class="item-tips">跟单及工作人员须在此前完成项目，客户验收</div>
                    </div>
                </div>




                <div class="layui-form-item">
                    <label class="layui-form-label">计划收款</label>
                    <div class="layui-input-block">
                        <input type="text" name="ai_expect_paydate" id="date" autocomplete="off"
                               class="layui-input laydate-icon laydate_date"
                               value="<? echo date("Y-m-d")?>"
                               
                               >
                        <div class="item-tips">业务须在此前完成收款。对私项目为10天。对公项目为两个月。</div>
                    </div>
                </div>



            </div>
        </div>



    </div>























    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
            <textarea name="ai_remark" placeholder="备注" class="layui-textarea"><? echo $detail['remark']?></textarea>
        </div>
    </div>







    <!--工作人员安排-->
    <?php include_once('mod-work-bonus.php'); ?>


    <?
    $bonus_list=select_lines_all_items($table_Prefix."bonus_plane","nid desc","status != '0'","");
    $bonus_name_array=transform_2darray_in_1darray_with_new_key($bonus_list,"nid","name");
    ?>

    <div class="layui-form-item">
        <label class="layui-form-label">提成方案</label>
        <div class="layui-input-block">
            <select name="ai_bonus">
                <option value="<? echo $detail['bonus']?>"><? echo $detail['bonus']." : ".$bonus_name_array[$detail['bonus']]?></option>
                <option value="">无</option>
                <? for($i=0;$i<count($bonus_list);$i++){ ?>
                    <option value="<? echo $bonus_list[$i]['nid'] ?>"><? echo $bonus_list[$i]['nid'] ?> : <? echo $bonus_list[$i]['name'] ?></option>
                <? } ?>
            </select>
        </div>
    </div>








    <br class="clearfloat"/>

    <div class="function">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="formMemberAdd" type="submit">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>


                    <input name="navitemed" type="hidden" value="<? echo $_REQUEST['nav-itemed'] ?>"/>
                    <input name="sys_part"  type="hidden" value="<? echo $system_part ?>"/>
                    <input name="nowpageid" type="hidden" value="<? echo $_REQUEST['nowpageid'] ?>"/>
                    <input name="sortby"    type="hidden" value="<? echo $_REQUEST['sortby'] ?>"/>
                    <input name="term_nid"  type="hidden" value="<? echo $_REQUEST['term_nid'] ?>"/>



</form>
 


 
 
        </div>
		
 
 
<!--content端點01-->
</div>
<!--maincontent端點01-->
<br class="clearfloat"/>
</div>
<!--container端點01-->
</div>








<?php include ROOT_PATH_ . "/controller/common/module/footer.php"; ?>
</body>
</html>
